import request from '@/utils/request'

// 获取角色列表
export function queryRoleList(data) {
  return request({
    url: '/sysRole/queryRoleList',
    method: 'post',
    data
  })
}

// 新增角色
export function addRole(data) {
  return request({
    url: '/sysRole/addRole',
    method: 'post',
    data
  })
}

// 删除角色
export function deleteRole(data) {
  return request({
    url: '/sysRole/deleteRole',
    method: 'delete',
    data
  })
}

// 导出角色列表
export function exportRoleList() {
  return request({
    url: '/sysRole/export',
    method: 'post',
    responseType: "blob"
  })
}

// 根据id查询
export function queryRoleById(roleId) {
  return request({
    url: '/sysRole/queryRoleById/'+roleId,
    method: 'get'
  })
}

// 修改角色信息
export function editRole(data) {
  return request({
    url: '/sysRole/editRole',
    method: 'put',
    data
  })
}
